package com.photo.commons;

import javax.servlet.*;


public class EncodingFilter implements Filter {
	    public void init(FilterConfig cong) {
			//		do nothing
		}

		public void doFilter(ServletRequest srequest, ServletResponse sresponse,
				FilterChain chain) {
			try{
				//编码
				srequest.setCharacterEncoding("UTF-8");
				//继续请求
				chain.doFilter(srequest, sresponse);
			}catch(Exception e){
				e.printStackTrace();
			}
		}

		public void destroy() {
			//do nothing
		}
	}